<template>
	<view v-if="!successful">
		<form report-submit='true'>
			<view class='merchantsSettled'>
				<image mode="widthFix" class="merchantBg" src="../static/images/merchantBg.jpg" alt="">
					<view class="application-record" @click="jumpToList">
						{{$t('store.Application.record')}}
						<text class="iconfont icon-xiangyou"></text>
					</view>
					<view class='list'>
						<view class="item">
							<view class="acea-row row-middle">
								<!-- <i class="icon iconfont icon-qiye"></i> -->
								<text class="item-name">{{$t('store.name')}}</text>
								<input type="text" maxlength="30" :placeholder="$t('store.store.enter.name')"
									v-model="merchantData.enterprise_name" @input="validateBtn"
									placeholder-class='placeholder' />
							</view>
						</view>
						<view class="item">
							<view class="acea-row row-middle">
								<!-- <i class="icon iconfont icon-yonghu3"></i> -->
								<text class="item-name">{{$t('store.user.name')}}</text>
								<input type="text" :placeholder="$t('store.enter.user.name')"
									v-model="merchantData.user_name" @input="validateBtn"
									placeholder-class='placeholder' />
							</view>
						</view>
						<view class="item">
							<view class="acea-row row-middle">
								<!-- <i class="icon iconfont icon-shoujihao"></i> -->
								<text class="item-name">{{$t('phone')}}</text>
								<input type="text" :placeholder="$t('store.enter.LINE')" v-model="merchantData.phone"
									@input="validateBtn" placeholder-class='placeholder' />

								<!-- 	<input type="text" :placeholder="$t('store.enter.LINE')" v-model="merchantData.phone"
										@input="validateBtn" placeholder-class='placeholder' /> -->
							</view>
						</view>

						<view class="item" v-if="isShowCode">
							<view class="acea-row row-middle">
								<!-- <i class="icon iconfont icon-yanzhengma"></i> -->
								<text class="item-name">{{$t('store.Verification')}}</text>
								<input type="text" :placeholder="$t('store.enter.Verification')" class="codeIput"
									v-model="codeVal" @input="validateBtn" placeholder-class='placeholder' />
								<view class="imageCode" @click="again">
									<image :src="codeUrl" />
								</view>
							</view>
						</view>
						<picker @change="bindPickerChange" :value="index" :range="array" range-key="category_name">
							<view class="item">
								<view class="uni-list">
									<view class="uni-list-cell">
										<view class="uni-list-cell-db acea-row row-middle">
											<text class="item-name">{{$t('store.cate')}}</text>
											<!-- <uni-input :placeholder="$t('store.select.cate')" type="text" readonly
												v-model="mer_classification" /> -->
											<!-- <input :placeholder="$t('store.select.cate')" type="text" disabled
												v-model="mer_classification"> -->
											<text :style="{color:mer_classification?'#333':'#999'}">{{mer_classification?mer_classification:$t('store.select.cate')}}</text>
											<view class='iconfont icon-jiantou'></view>

										</view>
									</view>
								</view>
							</view>
						</picker>
						<view class="item" v-if="isCode">
							<view class="acea-row row-middle">
								<!-- <i class="icon iconfont icon-shoujihao"></i> -->
								<text class="item-name">{{$t('store.invitation')}}</text>
								<input type="text" :placeholder="$t('store.enter.invitation2')"
									v-model="merchantData.invitation_code" @input="validateBtn"
									placeholder-class='placeholder' />
							</view>
						</view>
						<view class="item">
							<view class="acea-row row-middle">
								<!-- <i class="icon iconfont icon-shoujihao"></i> -->
								<text class="item-name">{{$t('store.user.number')}}</text>
								<input type="text" :placeholder="$t('store.enter.user.number')"
									v-model="merchantData.idcard" @input="validateBtn"
									placeholder-class='placeholder' />
							</view>
						</view>
						<picker @change="bindPickerChange1" :value="index1" :range="storeTypeArr" range-key="type_name">
							<view class="item">
								<view class="uni-list">
									<view class="uni-list-cell">
										<view class="uni-list-cell-db acea-row row-middle">
											<text class="item-name">{{$t('store.type')}}</text>
											<text class="iconfont wenhao" @click="getAgreement">?</text>

											<!-- <input :placeholder="$t('store.select.type')" type="text" disabled readonly
												v-model="mer_storeType"> -->
											<text :style="{color:mer_storeType?'#333':'#999'}">{{mer_storeType?mer_storeType:$t('store.select.type')}}</text>
											<view v-if="mer_storeType" @tap.stop="mer_storeType=''"
												class="iconfont icon-guanbi2"></view>
											<view class='iconfont icon-jiantou'></view>

										</view>
									</view>
								</view>
							</view>
						</picker>
						<view class="item no-border">
							<view class='acea-row row-middle'>
								<text class="item-title">{{$t('store.upload.note')}}</text>
								<text class="item-desc">{{$t('store.upload.limit')}}</text>
								<view class="upload">
									<view class='pictrue' v-for="(item,index) in pics" :key="index" :data-index="index"
										@click="getPhotoClickIdx">
										<image :src='item'></image>
										<text class='iconfont icon-guanbi1' @click.stop='DelPic(index)'></text>
									</view>
									<view class='pictrue acea-row row-center-wrapper row-column' @click='uploadpic'
										v-if="pics.length < 10">
										<text class='iconfont icon-icon25201'></text>
										<view>{{$t('store.upload')}}</view>
									</view>
								</view>
							</view>
						</view>

						<view class="item no-border">
							<checkbox-group @change='ChangeIsAgree'>
								<checkbox class="checkbox" :checked="isAgree ? true : false" />{{$t('store.agreent')}}
							</checkbox-group>
							<button class="settleAgree" @click="getConfig">{{$t('store.agreent.content')}}</button>
						</view>
						<button class='submitBtn' :class="btnState === true ? 'on':''"
							@click="formSubmit">{{$t('store.submit')}}</button>
						<button class='submitBtn'
							style="background: #FFFFFF;border:#E3E3E3 solid 1rpx ; color: #2C2C2C;" v-if="isAplay"
							@click="goTo">{{$t('store.login')}}</button>
					</view>
			</view>
		</form>
		<view class="settlementAgreement" v-if="showProtocol">
			<view class="setAgCount">
				<i class="icon iconfont icon-cha" @click="showProtocol = false"></i>
				<div class="title">{{isType ? $t('store.cate.note') : $t('store.shop.agreent')}}</div>
				<view class="content">
					<jyf-parser :html="protocol" ref="article" :tag-style="tagStyle"></jyf-parser>
					<!-- <view v-html="protocol"></view> -->
				</view>

			</view>
		</view>
		<view class='loadingicon acea-row row-center-wrapper' v-if="loading">
			<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>
		</view>
		<!-- #ifdef MP -->
		<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
		<!-- #endif -->
	</view>
	<view class="settledSuccessMain" v-else>
		<view class="settledSuccessful">
			<image class="image" src="/static/images/settledSuccessful.svg" alt="">
				<view class="title">{{$t('store.submit.succ')}}</view>
				<view class="info">{{$t('store.submit.check')}}</view>
				<view class="goHome" hover-class="none" @click="goHome">
					{{$t('store.home')}}
				</view>
		</view>
	</view>
</template>
<script>
	// +----------------------------------------------------------------------
	// | CRMEB [ CRMEB赋能开发者，助力企業发展 ]
	// +----------------------------------------------------------------------
	// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
	// +----------------------------------------------------------------------
	// | Licensed CRMEB並不是自由软件，未经许可不能去掉CRMEB相關版权
	// +----------------------------------------------------------------------
	// | Author: CRMEB Team <admin@crmeb.com>
	// +----------------------------------------------------------------------
	import {
		HTTP_REQUEST_URL
	} from '@/config/app';
	import {
		getconfig,
	} from '@/api/public.js';
	import {
		toLogin
	} from '@/libs/login.js';
	import {
		create,
		verify,
		merClassifly,
		getGoodsDetails,
		updateGoodsRecord,
		getStoreTypeApi
	} from '@/api/store.js';
	import {
		getUserInfo,
		getCaptcha,
		getAgreementApi
	} from "@/api/user";
	import {
		mapGetters
	} from "vuex";
	import parser from "@/components/jyf-parser/jyf-parser";
	// #ifdef MP
	import authorize from '@/components/Authorize';
	// #endif
	const app = getApp();
	export default {
		components: {
			"jyf-parser": parser,
			// #ifdef MP
			authorize,
			// #endif
		},
		data() {
			return {
				btnState:false,
				cartId: '', //購物車id
				pinkId: 0, //拼团id
				couponId: 0, //優惠券id
				isAuto: false, //没有授权的不會自动授权
				isShowAuth: false, //是否隐藏授权
				text: this.$t('store.Application.record'),
				codeUrl: "",
				disabled: false,
				isAgree: false,
				showProtocol: false,
				isShowCode: false,
				loading: false,
				merchantData: {
					enterprise_name: "",
					idcard: '',
					invitation_code: '',
					user_name: "",
					phone: "",
					classification: ''
				},
				validate: false,
				successful: false,
				keyCode: "",
				codeVal: "",
				isCode: false,
				isAplay: false,
				protocol: app.globalData.sys_intention_agree,
				timer: "",
				index: 0,
				index1: 0,
				mer_classification: "",
				array: [{
					category_name: '',
					merchant_category_id: ''
				}],
				storeTypeArr: [{
					type_name: '',
					mer_type_id: ''
				}],
				mer_storeType: '',
				pics: [],
				tagStyle: {
					img: 'width:100%;display:block;'
				},
				mer_i_id: null, // 商户申請id
				isType: false,
			};
		},
		beforeDestroy() {
			clearTimeout(this.timer)
		},
		watch: {
			dataChange: {
				handler(newValue, oldValue) {
					console.log("监听到了数据的变化", newValue);
					const {
						enterprise_name,
						user_name,
						phone,
						invitation_code,
						idcard,
						mer_classification,
						mer_storeType,
						pics,
						isAgree
					} = newValue
					if(enterprise_name&&user_name&&phone&&invitation_code&&idcard&&mer_classification&&mer_storeType&&pics.length&&isAgree){
						this.btnState = true
					}else{
						this.btnState = false
					}
				},
				deep: true
			}
		},
		computed: {
			...mapGetters(['isLogin']),
			dataChange() {
				const {
					enterprise_name,
					user_name,
					phone,
					invitation_code,
					idcard
				} = this.merchantData
				const {
					mer_classification,
					mer_storeType,
					pics,
					isAgree
				} = this
				return {
					enterprise_name,
					user_name,
					phone,
					invitation_code,
					idcard,
					mer_classification,
					mer_storeType,
					pics,
					isAgree
				}
			}
		},
		onLoad(options) {
			console.log(mapGetters(['isLogin']))
			console.log(options)
			if (this.isLogin) {
				this.getClassfication();
				this.getStoreType();
			} else {
				// #ifdef H5 || APP-PLUS
				toLogin();
				// #endif 
				// #ifdef MP
				this.isAuto = true;
				this.$set(this, 'isShowAuth', true)
				// #endif
			}
			if (options.mer_i_id) {
				this.mer_i_id = options.mer_i_id
				uni.showLoading({
					title: this.$t('store.get.data'),
				});
				this.$nextTick(function() {
					this.getGoodsDetails(options.mer_i_id)
				})
			}
		},
		// watch: {
		// 	dataChange: {
		// 		handler(newValue, oldValue) {
		// 			console.log("监听到了数据的变化", newValue);
		// 		},
		// 		deep: true
		// 	}
		// },
		// computed: {
		// 	dataChange() {
		// 		const {
		// 			isAgree,
		// 			merchantData
		// 		} = this
		// 	}
		// },
		onShow: function() {
			let that = this;
			if (that.isLogin) {
				this.getUserInfo();
			} else {
				// #ifdef H5 || APP-PLUS
				toLogin();
				// #endif
				// #ifdef APP-PLUS
				this.userInfo = {}
				// #endif
			}
		},
		onReady() {
			uni.$on('update', (data) => {
				this.protocol = data.sys_intention_agree
			})
		},
		methods: {
			goTo() {
				window.location.href = HTTP_REQUEST_URL + '/merchant/login?redirect=%2Fmerchant%2Fconfig%2Fservice';
			},
			getConfig() {
				this.isType = false;
				this.showProtocol = true;
				// 获取配置
				getconfig().then(res => {
					this.protocol = app.globalData.sys_intention_agree
				}).catch(err => {})
			},
			/*获取发票說明*/
			getAgreement() {
				let that = this
				that.showProtocol = true;
				that.isType = true
				getAgreementApi('sys_merchant_type').then(res => {
					that.protocol = res.data.sys_merchant_type
				})
			},
			// 获取历史提交数据详情
			getGoodsDetails(id) {
				getGoodsDetails(id).then(res => {
					console.log(res)
					let arr = Object.keys(this.merchantData)
					let resData = res.data
					arr.map(item => {
						this.merchantData.enterprise_name = resData.mer_name
						this.merchantData.user_name = resData.name
						this.merchantData.phone = resData.phone
						this.merchantData.classification = resData.merchant_category_id
					})
					this.pics = resData.images
					this.mer_classification = this.getCategoryName(resData.merchant_category_id, this.array)
					this.mer_storeType = this.getStoreTypeName(resData.mer_type_id, this.storeTypeArr)
					uni.hideLoading();
				})
			},
			/**
			 * 获取個人用户資訊 下个问题xiage 
			 */
			getUserInfo: function() {
				let _this = this;
				_this.merchantData.invitation_code = ''
				getUserInfo().then(res => {
					_this.merchantData.phone = res.data.phone
					if (res.data.spread_uid == 0)
						_this.isCode = true
					if (res.data.merchant_info.status == 1)
						_this.isAplay = true
				});
			},
			//获取商户分類名稱
			getCategoryName(id, arr) {
				for (let i = 0; i < arr.length; i++) {
					if (arr[i].merchant_category_id === id) {
						return arr[i]['category_name']
					}
				}
			},
			//获取店鋪類型名稱
			getStoreTypeName(id, arr) {
				for (let i = 0; i < arr.length; i++) {
					if (arr[i].mer_type_id === id) {
						return arr[i]['type_name']
					}
				}
			},
			bindPickerChange: function(e) {
				console.log('picker发送选择改变，携带值為', e.target.value)
				this.index = e.target.value
				let idx = e.target.value
				this.merchantData.classification = this.array[idx]['merchant_category_id']
				this.mer_classification = this.array[idx]['category_name']
			},
			bindPickerChange1: function(e) {
				console.log('picker发送选择改变，携带值為', e.target.value)
				this.index1 = e.target.value
				let idx = e.target.value
				this.merchantData.mer_type = this.storeTypeArr[idx]['mer_type_id']
				this.mer_storeType = this.storeTypeArr[idx]['type_name']
			},
			// 获取商户分類
			getClassfication: function() {
				merClassifly()
					.then(res => {
						if (uni.getLocale() == 'en') {
							res.data.forEach(val => {
								val.category_name = val.category_name_en;
							});
						}
						this.array = res.data
					})
					.catch(res => {
						this.$util.Tips({
							title: res
						});
					});
			},
			// 获取店鋪類型
			getStoreType: function() {
				getStoreTypeApi()
					.then(res => {
						if (uni.getLocale() == 'en') {
							res.data.forEach(val => {
								val.type_name = val.type_name_en;
							});
						}
						this.storeTypeArr = res.data
					})
					.catch(res => {
						this.$util.Tips({
							title: res
						});
					});
			},
			// 圖片預覽
			// 获得相册 idx
			getPhotoClickIdx(e) {
				let _this = this;
				let idx = e.currentTarget.dataset.index;
				_this.imgPreview(_this.pics, idx);
			},
			// 圖片預覽
			imgPreview: function(list, idx) {
				// list：圖片 url 数组
				if (list && list.length > 0) {
					uni.previewImage({
						current: list[idx], //  傳 Number H5端出现不兼容 
						urls: list
					});
				}
			},
			// 授权回调
			onLoadFun: function() {
				this.isShowAuth = false;
			},
			// 授权關闭
			authColse: function(e) {
				this.isShowAuth = e
			},
			toggleTab(str) {
				this.$refs[str].show();
			},
			// 首頁
			goHome() {
				uni.switchTab({
					url: '/pages/index/index'
				});
			},
			again() {
				this.getcaptcha()
			},
			/**
			 * 上傳文件
			 * 
			 */
			uploadpic: function() {
				let that = this;
				that.$util.uploadImageOne('upload/image', function(res) {
					that.pics.push(res.data.path);
					console.log(res.data);
					that.$set(that, 'pics', that.pics);
				});
				console.log(that.pics);
			},
			/**
			 * 删除圖片
			 * 
			 */
			DelPic: function(index) {
				let that = this,
					pic = this.pics[index];
				that.pics.splice(index, 1);
				that.$set(that, 'pics', that.pics);
			},
			getCode() {
				let that = this
				getCodeApi()
					.then(res => {
						that.keyCode = res.data.key;
					})
					.catch(res => {
						that.$util.Tips({
							title: res
						});
					});
			},
			async code() {
				let that = this;
				if (!that.merchantData.phone) return that.$util.Tips({
					title: this.$t('store.enter.user.LINE')
				});
				// if (!/^0\d{9}$/i.test(that.merchantData.phone)) return that.$util.Tips({
				// 	title: '請輸入正确的手機號碼'
				// });
				await verify({
						phone: that.merchantData.phone,
						key: that.codeKey,
						code: that.codeVal,
						type: 'intention'
					})
					.then(res => {
						that.$util.Tips({
							title: res.msg
						});
						that.sendCode();
					})
					.catch(res => {
						console.log(res, 'res22222222')

						that.$util.Tips({
							title: res
						});
						if (res.status == 402) {
							that.getcaptcha();
						}
					});
			},
			getcaptcha() {
				let that = this
				getCaptcha().then(data => {
					that.codeUrl = data.data.captcha; //圖片路径
					that.codeVal = data.data.code; //圖片驗證碼
					that.codeKey = data.data.key //圖片驗證碼key
				})
				that.isShowCode = true;
			},
			sendCode() {
				if (this.disabled) return;
				this.disabled = true;
				let n = 60;
				this.text = this.$t('store.sec.limit') + n + "s";
				const run = setInterval(() => {
					n = n - 1;
					if (n < 0) {
						clearInterval(run);
					}
					this.text = this.$t('store.sec.limit') + n + "s";
					if (this.text < this.$t('store.sec.limit') + 0 + "s") {
						this.disabled = false;
						this.text = this.$t('store.get.again');
					}
				}, 1000);
			},
			onConfirm(val) {
				this.region = val.checkArr[0] + '-' + val.checkArr[1] + '-' + val.checkArr[2];
			},
			ChangeIsAgree: function(e) {
				this.isAgree = !this.isAgree;
				this.validateBtn();
			},

			formSubmit: function(e) {
				let that = this;
				if (that.validateForm() && that.btnState) {
					let requestData = {
						phone: that.merchantData.phone,
						idcard: that.merchantData.idcard,
						invitation_code: that.merchantData.invitation_code,
						mer_name: that.merchantData.enterprise_name,
						name: that.merchantData.user_name,
						code: that.merchantData.yanzhengma,
						merchant_category_id: that.merchantData.classification,
						mer_type_id: that.merchantData.mer_type,
						images: that.pics
					}
					if (that.mer_i_id) {
						console.log('修改', requestData)
						updateGoodsRecord(that.mer_i_id, requestData).then(res => {
							if (res.status == 200) {
								title: this.$t('store.submit.succ.mess'),
								that.loading = true;
								this.timer = setTimeout(() => {
									that.successful = true;
								}, 1000)
							}
						}).catch(res => {
							that.$util.Tips({
								title: res
							});
						})
					} else {
						console.log('创建', requestData)
						create(requestData).then(data => {
							if (data.status == 200) {
								title: this.$t('store.submit.succ.mess'),
								that.loading = true;
								this.timer = setTimeout(() => {
									that.successful = true;
								}, 1000)
							}

						}).catch(res => {
							that.$util.Tips({
								title: res
							});
						})
					}

				}


			},
			validateBtn: function() {
				let that = this,
					value = that.merchantData;
				if (value.enterprise_name && value.user_name && value.phone && /^1(3|4|5|7|8|9|6)\d{9}$/i.test(value
						.phone) &&
					value.yanzhengma && that.isAgree) { // && value.classification
					if (!that.isShowCode) {
						that.btnState = true;
					} else {
						if (that.codeVal) {
							that.btnState = true;
						} else {
							that.btnState = false;
						}
					}

				}
			},

			validateForm: function() {
				let that = this,
					value = that.merchantData;

				if (!value.enterprise_name) return that.$util.Tips({
					title: this.$t('store.enterprise_name')
				});
				if (!value.user_name) return that.$util.Tips({
					title: this.$t('store.enter.user.name')
				});
				if (!value.phone) return that.$util.Tips({
					title: this.$t('store.enter.user.LINE')
				});
				// if (!/^0\d{9}$/i.test(value.phone)) return that.$util.Tips({
				// 	title: '請輸入正确的邮箱账号'
				// });
				if (!/^[0-9A-Za-z@+*._\s]{4,30}$/i.test(value.phone)) return that.$util.Tips({
					title: this.$t("enter.noemail")
				});
				// 	上面这是常用的的账号验证
				// if (!/^[a-zA-Z0-9]+([-_.][A-Za-zd]+)*@([a-zA-Z0-9]+[-.])+[A-Za-zd]{2,5}$/i.test(value.phone)) return that.$util.Tips({
				// 	title: this.$t('enter.noemail')
				// });
				// 	上面这是正确的邮箱账号验证
				// if (!value.idcard) return that.$util.Tips({
				// 	title: this.$t('store.enter.user.number')
				// });
				if (!value.classification) return that.$util.Tips({
					title: this.$t('store.select.cate')
				});
				console.log(that.pics)
				// if (that.pics.length==0) return that.$util.Tips({
				// 	title:this.$t('store.up.pic')
				// });
				if (!that.isAgree) return that.$util.Tips({
					title: this.$t('store.select.agreent')
				});
				
				return true;
			},
			jumpToList() {
				uni.navigateTo({
					url: "/pages/store/applicationRecord/index"
				})
			},

		}
	}
</script>

<style scoped lang="scss">
	.uni-input-placeholder {
		color: #B2B2B2;
	}

	.item-name {
		width: 190rpx;
	}

	.uni-list-cell {
		position: relative;

		.iconfont {
			font-size: 14px;
			color: #7a7a7a;
			position: absolute;
			right: 15px;
			top: 7rpx;
		}

		.icon-guanbi2 {
			right: 35px;
		}
	}

	.merchantsSettled {
		background: linear-gradient(#fd3d1d 0%, #fd151b 100%);
		height: 140vh;
	}

	.merchantsSettled .merchantBg {
		width: 750rpx;
		width: 100%;
	}

	.merchantsSettled .list {
		background-color: #fff;
		border-radius: 12px;
		padding: 22px 0;
		margin: 0 15px;
		position: absolute;
		top: 300rpx;
		// margin-top: -160px;
		width: calc(100% - 30px);
	}

	.application-record {
		position: absolute;
		display: flex;
		align-items: center;
		top: 240rpx;
		right: 0;
		color: #fff;
		font-size: 22rpx;
		background-color: rgba(0, 0, 0, 0.3);
		padding: 8rpx 18rpx;
		border-radius: 20px 0px 0px 20px;
	}

	.merchantsSettled .list .item {
		padding: 50rpx 0 20rpx;
		border-bottom: 1rpx solid #eee;
		position: relative;
		margin: 0 20px;

		&.no-border {
			border-bottom: none;
			padding-left: 0;
			padding-right: 0;
		}

		.item-title {
			color: #666666;
			font-size: 28rpx;
			display: block;
		}

		.item-desc {
			color: #B2B2B2;
			font-size: 22rpx;
			display: block;
			margin-top: 9rpx;
			line-height: 36rpx;
		}
	}

	.acea-row,
	.upload {
		display: -webkit-box;
		display: -moz-box;
		display: -webkit-flex;
		display: -ms-flexbox;
		display: flex;
		-webkit-box-lines: multiple;
		-moz-box-lines: multiple;
		-o-box-lines: multiple;
		-webkit-flex-wrap: wrap;
		-ms-flex-wrap: wrap;
		flex-wrap: wrap;
	}

	.upload {
		margin-top: 20rpx;
	}

	.acea-row.row-middle {
		-webkit-box-align: center;
		-moz-box-align: center;
		-o-box-align: center;
		-ms-flex-align: center;
		-webkit-align-items: center;
		align-items: center;
		padding-left: 2px;
	}

	.acea-row.row-column {
		-webkit-box-orient: vertical;
		-moz-box-orient: vertical;
		-o-box-orient: vertical;
		-webkit-flex-direction: column;
		-ms-flex-direction: column;
		flex-direction: column;
	}

	.acea-row.row-center-wrapper {
		-webkit-box-align: center;
		-moz-box-align: center;
		-o-box-align: center;
		-ms-flex-align: center;
		-webkit-align-items: center;
		align-items: center;
		-webkit-box-pack: center;
		-moz-box-pack: center;
		-o-box-pack: center;
		-ms-flex-pack: center;
		-webkit-justify-content: center;
		justify-content: center;
	}

	.merchantsSettled .list .item .pictrue {
		width: 130rpx;
		height: 130rpx;
		margin: 24rpx 22rpx 0 0;
		position: relative;
		font-size: 11px;
		color: #bbb;

		&:nth-child(4n) {
			margin-right: 0;
		}

		&:nth-last-child(1) {
			border: 0.5px solid #ddd;
			box-sizing: border-box;
		}


		uni-image,
		image {
			width: 100%;
			height: 100%;
			border-radius: 1px;

			img {
				-webkit-touch-callout: none;
				-webkit-user-select: none;
				-moz-user-select: none;
				display: block;
				position: absolute;
				top: 0;
				left: 0;
				opacity: 0;
				width: 100%;
				height: 100%;
			}
		}

		.icon-guanbi1 {
			font-size: 33rpx;
			position: absolute;
			top: -10px;
			right: -10px;
		}
	}

	.uni-list-cell-db {
		position: relative;
	}

	.wenhao {
		width: 34rpx;
		height: 34rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 28rpx;
		border-radius: 50%;
		background: #E3E3E3;
		color: #ffffff !important;
		margin-left: 4rpx;
		position: absolute;
		left: 122rpx;
	}

	.merchantsSettled .list .item .imageCode {
		position: absolute;
		top: 7px;
		right: 0;
	}

	.merchantsSettled .list .item .icon {
		font-size: 40rpx;
		color: #b4b1b4;
	}

	.merchantsSettled .list .item input {
		width: 400rpx;
		font-size: 30rpx;
		// margin-left: 30px;
	}

	.merchantsSettled .list .item .placeholder {
		color: #b2b2b2;
	}

	.merchantsSettled .default {
		padding: 0 30rpx;
		height: 90rpx;
		background-color: #fff;
		margin-top: 23rpx;
	}

	.merchantsSettled .default checkbox {
		margin-right: 15rpx;
	}

	.merchantsSettled .acea-row uni-image {
		width: 20px;
		height: 20px;
		display: block;
	}

	.merchantsSettled .list .item .codeIput {
		width: 125px;
	}

	.uni-input-input {
		display: block;
		height: 100%;
		background: none;
		color: inherit;
		opacity: 1;
		-webkit-text-fill-color: currentcolor;
		font: inherit;
		line-height: inherit;
		letter-spacing: inherit;
		text-align: inherit;
		text-indent: inherit;
		text-transform: inherit;
		text-shadow: inherit;
	}

	.merchantsSettled .list .item .code {
		position: absolute;
		width: 93px;
		line-height: 27px;
		border: 1px solid #E93323;
		border-radius: 15px;
		color: #E93323;
		text-align: center;
		bottom: 8px;
		right: 0;
		font-size: 12px;
	}

	.merchantsSettled .list .item .code.on {
		background-color: #bbb;
		color: #fff;
		border-color: #bbb;
	}

	.merchantsSettled .submitBtn {
		width: 588rpx;
		margin: 0 auto;
		height: 86rpx;
		border-radius: 25px;
		text-align: center;
		line-height: 86rpx;
		font-size: 15px;
		color: #fff;
		background: #E3E3E3;
		margin-top: 25px;
	}

	.merchantsSettled .submitBtn.on {
		background: #E93323;
	}

	uni-checkbox-group,
	.settleAgree {
		display: inline-block;
		font-size: 24rpx;
	}

	uni-checkbox-group {
		color: #b2b2b2;
	}

	.settleAgree {
		color: #E93323;
		position: relative;
		top: 2px;
		left: 8px;
	}

	.merchantsSettled uni-checkbox .uni-checkbox-wrapper {
		width: 30rpx;
		height: 30rpx;
		border: 2rpx solid #C3C3C3;
		border-radius: 15px;
	}

	.settlementAgreement {
		width: 100%;
		height: 100%;
		position: fixed;
		top: 0;
		left: 0;
		background: rgba(0, 0, 0, .5);
		z-index: 10;
	}

	.settlementAgreement .setAgCount {
		background: #fff;
		width: 656rpx;
		height: 458px;
		position: absolute;
		top: 50%;
		left: 50%;
		border-radius: 12rpx;
		-webkit-border-radius: 12rpx;
		padding: 52rpx;
		-webkit-transform: translate(-50%, -50%);
		-moz-transform: translate(-50%, -50%);
		transform: translate(-50%, -50%);
		overflow: hidden;

		.content {
			height: 900rpx;
			overflow-y: scroll;

			::v-deep p {
				font-size: 13px;
				line-height: 22px;
			}

			::v-deep img {
				max-width: 100%;
			}
		}
	}

	.settlementAgreement .setAgCount .icon {
		font-size: 42rpx;
		color: #b4b1b4;
		position: absolute;
		top: 15rpx;
		right: 15rpx;

	}

	.settlementAgreement .setAgCount .title {
		color: #333;
		font-size: 32rpx;
		text-align: center;
		font-weight: bold;
	}

	.settlementAgreement .setAgCount .content {
		margin-top: 32rpx;
		color: #333;
		font-size: 26rpx;
		line-height: 22px;
		text-align: justify;
		text-justify: distribute-all-lines;
		height: 756rpx;
		overflow-y: scroll;
	}

	.settledSuccessMain {
		height: 100vh;
		display: flex;
		flex-direction: column;
		background: #fff;
	}

	.settledSuccessful {
		flex: 1;
		width: 100%;
		padding: 0 56px;
		height: auto;
		background: #fff;
		text-align: center;
	}

	.settledSuccessful .image {
		width: 189px;
		height: 157px;
		margin-top: 66px;
	}

	.settledSuccessful .title {
		color: #333333;
		font-size: 16px;
		font-weight: bold;
		margin-top: 35px;
	}

	.settledSuccessful .info {
		color: #A0A0A0;
		font-size: 13px;
		margin-top: 12px;
	}

	.settledSuccessful .goHome {
		margin: 60px auto 0;
		line-height: 43px;
		color: #282828;
		font-size: 15px;
		border: 1px solid #B4B4B4;
		border-radius: 60px;
	}

	::v-deep uni-checkbox .uni-checkbox-input {
		width: 15px;
		height: 15px;
		position: relative;
	}

	::v-deep uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked:before {
		font-size: 14px;
	}

	.loadingicon {
		height: 100vh;
		overflow: hidden;
		position: absolute;
		top: 0;
		left: 0;
	}

	.icon-xiangyou {
		font-size: 22rpx;
	}

	// #ifdef MP
	checkbox-group {
		display: inline-block;
	}

	// #endif
	.setAgCount {
		::v-deep table {
			border: 1rpx solid #DDD;
			border-bottom: none;
			border-right: none;
		}

		::v-deep td,
		th {
			padding: 5rpx 10rpx;
			border-bottom: 1rpx solid #DDD;
			border-right: 1rpx solid #DDD;
		}
	}
</style>